﻿using UnityEngine;
using System.Collections;

public class StaticObstacle : Obstacle {


	public ParticleSystem DestroyParts;
	public GameObject Parts;
	//public GameObject Parent;
	
	void OnTriggerEnter ()
	{
		DestroyParts.Play();
		Parts = Instantiate (DestroyParts, new Vector3(transform.position.x, transform.position.y+1.7f, transform.position.z), Quaternion.identity) as GameObject;
		Destroy(gameObject);
	
	}
	
	void OnCollisionEnter ()
	{
		DestroyParts.Play();
		
		Parts = Instantiate (DestroyParts, new Vector3(transform.position.x, transform.position.y+1.7f, transform.position.z), Quaternion.identity) as GameObject;
		Destroy(gameObject);
		
	}
	
	void Update()
	{
	
	//	transform.Translate(Parent.transform.position);
	}
}
